import { Cookie } from '@wattjs/network'

export const ll = {
  get: (key) => {
    if (window.utools) {
      return utools.dbStorage.getItem(key)
    } else {
      return Cookie.get(key)
    }
  },
  set: (key, val, opts) => {
    if (window.utools) {
      utools.dbStorage.setItem(key, val)
    } else {
      Cookie.set(key, val, opts)
    }
  },
  remove: (key) => {
    if (window.utools) {
      utools.dbStorage.removeItem(key)
    } else {
      Cookie.remove(key)
    }
  }
}
